Skip to content

feat(capture): og:image hero images for readable boards + modal star fix - #8

Merged
Seanathon merged 2 commits into
mainfrom
feat/og-image-capture
Jun 27, 2026
Merged

feat(capture): og:image hero images for readable boards + modal star fix#8
Seanathon merged 2 commits into
mainfrom
feat/og-image-capture

Conversation

@Seanathon

Copy link
Copy Markdown
Owner

Two commits.

1. feat(capture): pull og:image so readable/product cards get a hero image

A "Wish List" board (url-readable + a featured_image field) captured fine but never got a product image, silently — because image descriptor fields had no fill path: the AI skips image fields by design (can't emit a screenshot) and url-readable produced no image.

Now url-readable also extracts the page's og:image (secure first → twitter:image → JSON-LD product image → link[rel=image_src]) from the HTML captureLibrary already fetched (zero extra network) and downloads it as the item's image asset:

  • extractOgImage(html, url) — pure, resolves relative URLs.
  • Download is SSRF-guarded (assertCapturableUrl) and capped (12MB, 8s, image content-types only); stored as a kind: 'image' asset. Any failure leaves the capture successful with no asset (best-effort).
  • hydrate surfaces a kind: 'image' asset as the card/modal image when there's no screenshot.
  • Honest fallback: empty placeholder reads "No image" (was "No screenshot").

Verified live: refetching the Edifier product item produced its real product photo on the card.

2. fix(ui): keep the modal favorite star clear of the close button

With no screenshot, the modal title row sits at the top and the favorite star collided with the absolute close button. Reserve right padding on the title row in the no-screenshot case (.no-shot modifier). With a screenshot the layout is unchanged.


Verified: tsc clean; 532 tests pass (+8: 5 extractOgImage, 3 download-path). Browser-confirmed both the og:image render and the modal spacing.

Independent of the still-open #7 (empty-state copy ordering).

🤖 Generated with Claude Code

Seanathon and others added 2 commits June 27, 2026 00:07
Image descriptor fields had no fill path: the AI skips image fields by design
(it can't emit a screenshot), and url-readable capture produced no image — so a
board with an image field (e.g. a 'Wish List' with featured_image) silently
showed nothing, status 'done', no error.

Now url-readable also extracts the page's og:image (secure first, then
twitter:image, JSON-LD product image, link[rel=image_src]) from the HTML
captureLibrary already fetched — zero extra network — and downloads it as the
item's image asset:
- extractOgImage(html, url) — pure, resolves relative URLs (processor-library).
- url-readable adapter downloads it: SSRF-guarded (assertCapturableUrl), capped
  (12MB, 8s, image content-types only), stored as a kind:'image' asset. Any
  failure leaves the capture successful with no asset (best-effort).
- hydrate surfaces a kind:'image' asset as the card/modal image when there's no
  screenshot.
- honest fallback: empty placeholder reads 'No image' (was 'No screenshot').

Verified live: refetching the Edifier product item produced its real product
photo. tsc clean; +8 tests (5 extractOgImage, 3 download-path).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In the item-detail modal the favorite star sits at the end of the title row.
With a screenshot the close button (absolute, top-right) floats over the image
and the row clears it; with NO screenshot the row is at the very top, so the
star collided with the close button. Reserve right padding on the title row in
the no-screenshot case (a .no-shot modifier) so the star clears it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Seanathon
Seanathon merged commit 4dc32ae into main Jun 27, 2026
2 checks passed
@Seanathon
Seanathon deleted the feat/og-image-capture branch June 27, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant